import * as types from '../mutation_types';

export default {
  [types.SET_CURRENT_USER](state, userData) {
    Object.assign(state, {
      currentUser: userData,
    });
  },
  [types.SET_SHOWING_USER](state, userData) {
    Object.assign(state, {
      showingUser: userData,
    });
  },
  [types.SET_UNREAD_COMMENTS_COUNT](state, count) {
    Object.assign(state, {
      unreadCommentsCount: count,
    });
  },
  [types.SET_UNREAD_VOTES_COUNT](state, count) {
    Object.assign(state, {
      unreadVotesCount: count,
    });
  },
  [types.SET_UNREAD_ANNC_COUNT](state, count) {
    Object.assign(state, {
      unreadAnncCount: count,
    });
  },
  [types.SET_UNREAD_OTHER_COUNT](state, count) {
    Object.assign(state, {
      unreadOtherCount: count,
    });
  },
  [types.SET_CURRENT_SPACE](state, spaceData) {
    Object.assign(state, {
      currentSpace: spaceData,
    });
  },
  [types.SET_SIDEBAR_COLLAPSED](state, collapsed) {
    Object.assign(state, {
      sidebarCollapsed: collapsed,
    });
  },
  [types.SET_CURRENT_DOCUMENT](state, doc) {
    Object.assign(state, {
      currentDocument: doc,
    });
  },
  [types.SET_CURRENT_ISSUE](state, issue) {
    Object.assign(state, {
      currentIssue: issue,
    });
  },
  [types.SET_CURRENT_CONTRIBUTION](state, contribution) {
    Object.assign(state, {
      currentContribution: contribution,
    });
  },
  [types.SET_CURRENT_GROUP](state, group) {
    Object.assign(state, {
      currentGroup: group,
    });
  },
  [types.SET_CURRENT_QUESTIONNAIRE](state, questionnaire) {
    Object.assign(state, {
      currentQuestionnaire: questionnaire,
    });
  },
  [types.SET_INVISIBLE_SIDEBAR](state, invisible) {
    Object.assign(state, {
      invisibleSidebar: invisible,
    });
  },
  [types.SET_CURRENT_SPACE_SIDEBAR_STATISTICS](state, statistics) {
    Object.assign(state, {
      currentSpaceSidebarStatistics: statistics,
    });
  },
  [types.SET_CURRENT_COMMUNITY](state, community) {
    Object.assign(state, {
      currentCommunity: community,
    });
  },
  [types.SET_CURRENT_FEEDBACK](state, feedback) {
    Object.assign(state, {
      currentFeedback: feedback,
    });
  },
  [types.SET_CURRENT_GOOD_RESOURCES_TABS_2](state, tabs) {
    Object.assign(state, {
      currentGoodResourcesTabs2: tabs,
    });
  },
  [types.SET_SELECTED_FOLDER](state, folder = {}) {
    Object.assign(state, {
      selectedFolder: folder,
    });
  },
  [types.SET_CURRENT_FOLDER](state, folder) {
    Object.assign(state, {
      currentFolder: folder,
    });
  },
  [types.SET_PRE_UPLOADS](state, uploads) {
    Object.assign(state, {
      preUploads: uploads,
    });
  },
};
